# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-flake8-per-file-ignores
pkgname=('python2-flake8-per-file-ignores' 'python-flake8-per-file-ignores')
_pkgname=flake8-per-file-ignores
pkgver=0.8.1
pkgrel=8
pkgdesc='Ignore individual error codes per file with flake8.'
url='https://pypi.org/project/flake8-per-file-ignores/#files'
arch=('any')
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8fb25f576682d9146ee5396b04b034b5fb7b8ebd9aaef8ee01ca4dbf3d678a7c4df3efd48a45402b6bd2ab5b7a2a1b049863e5a72729a0a3b3ab7c577c29841c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flake8-per-file-ignores() {
  depends=('python2' 'python2-pathmatch')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-flake8-per-file-ignores() {
  depends=('python' 'python-pathmatch')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

